package BinaryTreePackage2;

/**
 * @author Lzm
 * @version 1.0
 */
public class invertTree_ {

  public TreeNode invertTree(TreeNode root) {
    backTracking(root);
    return root;
  }
  public void backTracking(TreeNode root){
    if (root == null){
      return;
    }

    backTracking(root.left);
    backTracking(root.right);
    TreeNode temp = root.left;
    root.left = root.right;
    root.right = temp;
  }
}
